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

Side by Side Diff: mojo/shell/test_package_manager.cc

Issue 1354813002: Revert of Don't use resolved url for instance identity in ApplicationManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « mojo/shell/test_package_manager.h ('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 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 "mojo/shell/test_package_manager.h" 5 #include "mojo/shell/test_package_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/shell/fetcher.h" 8 #include "mojo/shell/fetcher.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace shell { 12 namespace shell {
13 13
14 TestPackageManager::TestPackageManager() {} 14 TestPackageManager::TestPackageManager() {}
15 TestPackageManager::~TestPackageManager() {} 15 TestPackageManager::~TestPackageManager() {}
16 16
17 void TestPackageManager::RegisterContentHandler( 17 void TestPackageManager::RegisterContentHandler(
18 const std::string& mime_type, 18 const std::string& mime_type,
19 const GURL& content_handler_url) { 19 const GURL& content_handler_url) {
20 DCHECK(content_handler_url.is_valid()) 20 DCHECK(content_handler_url.is_valid())
21 << "Content handler URL is invalid for mime type " << mime_type; 21 << "Content handler URL is invalid for mime type " << mime_type;
22 mime_type_to_url_[mime_type] = content_handler_url; 22 mime_type_to_url_[mime_type] = content_handler_url;
23 } 23 }
24 24
25 void TestPackageManager::SetApplicationManager(ApplicationManager* manager) { 25 void TestPackageManager::SetApplicationManager(ApplicationManager* manager) {
26 } 26 }
27 27
28 GURL TestPackageManager::ResolveURL(const GURL& url) {
29 return url;
30 }
31
28 void TestPackageManager::FetchRequest( 32 void TestPackageManager::FetchRequest(
29 URLRequestPtr request, 33 URLRequestPtr request,
30 const Fetcher::FetchCallback& loader_callback) {} 34 const Fetcher::FetchCallback& loader_callback) {}
31 35
32 bool TestPackageManager::HandleWithContentHandler( 36 bool TestPackageManager::HandleWithContentHandler(
33 Fetcher* fetcher, 37 Fetcher* fetcher,
34 const GURL& url, 38 const GURL& unresolved_url,
35 base::TaskRunner* task_runner, 39 base::TaskRunner* task_runner,
36 URLResponsePtr* new_response, 40 URLResponsePtr* new_response,
37 GURL* content_handler_url, 41 GURL* content_handler_url,
38 std::string* qualifier) { 42 std::string* qualifier) {
39 MimeTypeToURLMap::iterator iter = mime_type_to_url_.find(fetcher->MimeType()); 43 MimeTypeToURLMap::iterator iter = mime_type_to_url_.find(fetcher->MimeType());
40 if (iter != mime_type_to_url_.end()) { 44 if (iter != mime_type_to_url_.end()) {
41 *new_response = fetcher->AsURLResponse(task_runner, 0); 45 *new_response = fetcher->AsURLResponse(task_runner, 0);
42 *content_handler_url = iter->second; 46 *content_handler_url = iter->second;
43 *qualifier = (*new_response)->site.To<std::string>(); 47 *qualifier = (*new_response)->site.To<std::string>();
44 return true; 48 return true;
45 } 49 }
46 return false; 50 return false;
47 } 51 }
48 52
49 } // namespace shell 53 } // namespace shell
50 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/test_package_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698