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

Side by Side Diff: content/browser/webui/web_ui_data_source_impl.cc

Issue 835253002: Update mojo sdk to rev e3719475d5971283d1d2250533d53066b2ff9797 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/webui/web_ui_data_source_impl.h" 5 #include "content/browser/webui/web_ui_data_source_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // static 25 // static
26 WebUIDataSource* WebUIDataSource::AddMojoDataSource( 26 WebUIDataSource* WebUIDataSource::AddMojoDataSource(
27 BrowserContext* browser_context) { 27 BrowserContext* browser_context) {
28 WebUIDataSource* mojo_source = Create("mojo"); 28 WebUIDataSource* mojo_source = Create("mojo");
29 29
30 static const struct { 30 static const struct {
31 const char* path; 31 const char* path;
32 int id; 32 int id;
33 } resources[] = { 33 } resources[] = {
34 { mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS },
34 { mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS }, 35 { mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS },
35 { mojo::kCodecModuleName, IDR_MOJO_CODEC_JS }, 36 { mojo::kCodecModuleName, IDR_MOJO_CODEC_JS },
36 { mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS }, 37 { mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS },
37 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS }, 38 { mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS },
38 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS }, 39 { mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS },
39 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS }, 40 { mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS },
40 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS }, 41 { mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS },
41 }; 42 };
42 for (size_t i = 0; i < arraysize(resources); ++i) 43 for (size_t i = 0; i < arraysize(resources); ++i)
43 mojo_source->AddResourcePath(resources[i].path, resources[i].id); 44 mojo_source->AddResourcePath(resources[i].path, resources[i].id);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 239 }
239 240
240 void WebUIDataSourceImpl::SendFromResourceBundle( 241 void WebUIDataSourceImpl::SendFromResourceBundle(
241 const URLDataSource::GotDataCallback& callback, int idr) { 242 const URLDataSource::GotDataCallback& callback, int idr) {
242 scoped_refptr<base::RefCountedStaticMemory> response( 243 scoped_refptr<base::RefCountedStaticMemory> response(
243 GetContentClient()->GetDataResourceBytes(idr)); 244 GetContentClient()->GetDataResourceBytes(idr));
244 callback.Run(response.get()); 245 callback.Run(response.get());
245 } 246 }
246 247
247 } // namespace content 248 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698