Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: content/renderer/web_ui_mojo_context_state.cc

Issue 532773002: Implement ManifestFetcher, helper to fetch Web Manifests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/resource_fetcher_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/web_ui_mojo_context_state.h" 5 #include "content/renderer/web_ui_mojo_context_state.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/public/renderer/resource_fetcher.h" 9 #include "content/public/renderer/resource_fetcher.h"
10 #include "content/renderer/web_ui_runner.h" 10 #include "content/renderer/web_ui_runner.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const GURL url(kModulePrefix + id); 93 const GURL url(kModulePrefix + id);
94 // TODO(sky): better error checks here? 94 // TODO(sky): better error checks here?
95 DCHECK(url.is_valid() && !url.is_empty()); 95 DCHECK(url.is_valid() && !url.is_empty());
96 DCHECK(fetched_modules_.find(id) == fetched_modules_.end()); 96 DCHECK(fetched_modules_.find(id) == fetched_modules_.end());
97 fetched_modules_.insert(id); 97 fetched_modules_.insert(id);
98 ResourceFetcher* fetcher = ResourceFetcher::Create(url); 98 ResourceFetcher* fetcher = ResourceFetcher::Create(url);
99 module_fetchers_.push_back(fetcher); 99 module_fetchers_.push_back(fetcher);
100 fetcher->Start(frame_, 100 fetcher->Start(frame_,
101 blink::WebURLRequest::RequestContextScript, 101 blink::WebURLRequest::RequestContextScript,
102 blink::WebURLRequest::FrameTypeNone, 102 blink::WebURLRequest::FrameTypeNone,
103 ResourceFetcher::PLATFORM_LOADER,
103 base::Bind(&WebUIMojoContextState::OnFetchModuleComplete, 104 base::Bind(&WebUIMojoContextState::OnFetchModuleComplete,
104 base::Unretained(this), 105 base::Unretained(this),
105 fetcher)); 106 fetcher));
106 } 107 }
107 108
108 void WebUIMojoContextState::OnFetchModuleComplete( 109 void WebUIMojoContextState::OnFetchModuleComplete(
109 ResourceFetcher* fetcher, 110 ResourceFetcher* fetcher,
110 const blink::WebURLResponse& response, 111 const blink::WebURLResponse& response,
111 const std::string& data) { 112 const std::string& data) {
112 DCHECK_EQ(kModulePrefix, 113 DCHECK_EQ(kModulePrefix,
(...skipping 18 matching lines...) Expand all
131 const std::vector<std::string>& dependencies) { 132 const std::vector<std::string>& dependencies) {
132 FetchModules(dependencies); 133 FetchModules(dependencies);
133 134
134 gin::ContextHolder* context_holder = runner_->GetContextHolder(); 135 gin::ContextHolder* context_holder = runner_->GetContextHolder();
135 gin::ModuleRegistry* registry = gin::ModuleRegistry::From( 136 gin::ModuleRegistry* registry = gin::ModuleRegistry::From(
136 context_holder->context()); 137 context_holder->context());
137 registry->AttemptToLoadMoreModules(context_holder->isolate()); 138 registry->AttemptToLoadMoreModules(context_holder->isolate());
138 } 139 }
139 140
140 } // namespace content 141 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/resource_fetcher_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698