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

Side by Side Diff: chrome/browser/dom_ui/dom_ui_factory.cc

Issue 288005: First fix to minimize copying of image data. (Closed)
Patch Set: Modify gyp Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/dom_ui/dom_ui_factory.h" 5 #include "chrome/browser/dom_ui/dom_ui_factory.h"
6 6
7 #include "chrome/browser/dom_ui/downloads_ui.h" 7 #include "chrome/browser/dom_ui/downloads_ui.h"
8 #include "chrome/browser/dom_ui/devtools_ui.h" 8 #include "chrome/browser/dom_ui/devtools_ui.h"
9 #include "chrome/browser/dom_ui/history_ui.h" 9 #include "chrome/browser/dom_ui/history_ui.h"
10 #include "chrome/browser/dom_ui/html_dialog_ui.h" 10 #include "chrome/browser/dom_ui/html_dialog_ui.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // static 113 // static
114 DOMUI* DOMUIFactory::CreateDOMUIForURL(TabContents* tab_contents, 114 DOMUI* DOMUIFactory::CreateDOMUIForURL(TabContents* tab_contents,
115 const GURL& url) { 115 const GURL& url) {
116 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(url); 116 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(url);
117 if (!function) 117 if (!function)
118 return NULL; 118 return NULL;
119 return (*function)(tab_contents, url); 119 return (*function)(tab_contents, url);
120 } 120 }
121 121
122 // static 122 // static
123 bool DOMUIFactory::GetFaviconResourceBytes(const GURL& page_url, 123 RefCountedMemory* DOMUIFactory::GetFaviconResourceBytes(
124 std::vector<unsigned char>* bytes) { 124 const GURL& page_url) {
125 if (!HasDOMUIScheme(page_url)) 125 if (!HasDOMUIScheme(page_url))
126 return false; 126 return NULL;
127 127
128 if (page_url.host() == chrome::kChromeUIHistoryHost) 128 if (page_url.host() == chrome::kChromeUIHistoryHost)
129 return HistoryUI::GetFaviconResourceBytes(bytes); 129 return HistoryUI::GetFaviconResourceBytes();
130 130
131 if (page_url.host() == chrome::kChromeUIDownloadsHost) 131 if (page_url.host() == chrome::kChromeUIDownloadsHost)
132 return DownloadsUI::GetFaviconResourceBytes(bytes); 132 return DownloadsUI::GetFaviconResourceBytes();
133 133
134 return false; 134 return NULL;
135 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698