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

Side by Side Diff: content/browser/mojo/mojo_shell_context.cc

Issue 1905553003: Adds DCHECK to BuiltinManifestProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 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 | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mojo/mojo_shell_context.h" 5 #include "content/browser/mojo/mojo_shell_context.h"
6 6
7 #include <unordered_map> 7 #include <unordered_map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 private: 142 private:
143 // catalog::ManifestProvider: 143 // catalog::ManifestProvider:
144 bool GetApplicationManifest(const base::StringPiece& name, 144 bool GetApplicationManifest(const base::StringPiece& name,
145 std::string* manifest_contents) override { 145 std::string* manifest_contents) override {
146 auto it = manifest_resources_.find(name.as_string()); 146 auto it = manifest_resources_.find(name.as_string());
147 if (it == manifest_resources_.end()) 147 if (it == manifest_resources_.end())
148 return false; 148 return false;
149 *manifest_contents = GetContentClient()->GetDataResource( 149 *manifest_contents = GetContentClient()->GetDataResource(
150 it->second, ui::ScaleFactor::SCALE_FACTOR_NONE).as_string(); 150 it->second, ui::ScaleFactor::SCALE_FACTOR_NONE).as_string();
151 DCHECK(!manifest_contents->empty());
151 return true; 152 return true;
152 } 153 }
153 154
154 std::unordered_map<std::string, int> manifest_resources_; 155 std::unordered_map<std::string, int> manifest_resources_;
155 156
156 DISALLOW_COPY_AND_ASSIGN(BuiltinManifestProvider); 157 DISALLOW_COPY_AND_ASSIGN(BuiltinManifestProvider);
157 }; 158 };
158 159
159 // Thread-safe proxy providing access to the shell context from any thread. 160 // Thread-safe proxy providing access to the shell context from any thread.
160 class MojoShellContext::Proxy { 161 class MojoShellContext::Proxy {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 shell::Identity source_id(requestor_name, user_id); 336 shell::Identity source_id(requestor_name, user_id);
336 params->set_source(source_id); 337 params->set_source(source_id);
337 params->set_target(shell::Identity(name, user_id)); 338 params->set_target(shell::Identity(name, user_id));
338 params->set_remote_interfaces(std::move(request)); 339 params->set_remote_interfaces(std::move(request));
339 params->set_local_interfaces(std::move(exposed_services)); 340 params->set_local_interfaces(std::move(exposed_services));
340 params->set_connect_callback(callback); 341 params->set_connect_callback(callback);
341 shell_->Connect(std::move(params)); 342 shell_->Connect(std::move(params));
342 } 343 }
343 344
344 } // namespace content 345 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698