24bf2b62f47bf27b52f257488993db7d111deaf5
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / runtime_resource_dispatcher_host_delegate.cc
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #include "xwalk/runtime/browser/runtime_resource_dispatcher_host_delegate.h"
7
8 #include "base/lazy_instance.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/resource_controller.h"
13 #include "content/public/browser/resource_dispatcher_host.h"
14 #include "content/public/browser/resource_dispatcher_host_login_delegate.h"
15 #include "content/public/browser/resource_request_info.h"
16 #include "content/public/browser/resource_throttle.h"
17 #include "content/public/common/url_constants.h"
18 #include "net/base/load_flags.h"
19 #include "net/http/http_response_headers.h"
20 #include "net/url_request/url_request.h"
21
22 namespace {
23 base::LazyInstance<xwalk::RuntimeResourceDispatcherHostDelegate>
24     g_runtime_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER;
25 }
26
27 namespace xwalk {
28
29 RuntimeResourceDispatcherHostDelegate::RuntimeResourceDispatcherHostDelegate() {
30 }
31
32 RuntimeResourceDispatcherHostDelegate::
33 ~RuntimeResourceDispatcherHostDelegate() {
34 }
35
36 // static
37 void RuntimeResourceDispatcherHostDelegate::ResourceDispatcherHostCreated() {
38   content::ResourceDispatcherHost::Get()->SetDelegate(
39       &g_runtime_resource_dispatcher_host_delegate.Get());
40 }
41
42 void RuntimeResourceDispatcherHostDelegate::RequestBeginning(
43     net::URLRequest* request,
44     content::ResourceContext* resource_context,
45     appcache::AppCacheService* appcache_service,
46     ResourceType::Type resource_type,
47     int child_id,
48     int route_id,
49     ScopedVector<content::ResourceThrottle>* throttles) {
50 }
51
52 void RuntimeResourceDispatcherHostDelegate::DownloadStarting(
53     net::URLRequest* request,
54     content::ResourceContext* resource_context,
55     int child_id,
56     int route_id,
57     int request_id,
58     bool is_content_initiated,
59     bool must_download,
60     ScopedVector<content::ResourceThrottle>* throttles) {
61 }
62
63 bool RuntimeResourceDispatcherHostDelegate::HandleExternalProtocol(
64     const GURL& url,
65     int child_id,
66     int route_id,
67     bool initiated_by_user_gesture) {
68   return true;
69 }
70
71 }  // namespace xwalk