OLD | NEW |
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 "chrome/browser/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 return false; | 904 return false; |
905 } | 905 } |
906 | 906 |
907 // static | 907 // static |
908 bool PrerenderManager::IsValidHttpMethod(const std::string& method) { | 908 bool PrerenderManager::IsValidHttpMethod(const std::string& method) { |
909 // method has been canonicalized to upper case at this point so we can just | 909 // method has been canonicalized to upper case at this point so we can just |
910 // compare them. | 910 // compare them. |
911 DCHECK_EQ(method, StringToUpperASCII(method)); | 911 DCHECK_EQ(method, base::StringToUpperASCII(method)); |
912 for (size_t i = 0; i < arraysize(kValidHttpMethods); ++i) { | 912 for (size_t i = 0; i < arraysize(kValidHttpMethods); ++i) { |
913 if (method.compare(kValidHttpMethods[i]) == 0) | 913 if (method.compare(kValidHttpMethods[i]) == 0) |
914 return true; | 914 return true; |
915 } | 915 } |
916 | 916 |
917 return false; | 917 return false; |
918 } | 918 } |
919 | 919 |
920 // static | 920 // static |
921 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { | 921 bool PrerenderManager::DoesURLHaveValidScheme(const GURL& url) { |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 content::RenderProcessHost* host) { | 1918 content::RenderProcessHost* host) { |
1919 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1919 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1920 prerender_process_hosts_.erase(host); | 1920 prerender_process_hosts_.erase(host); |
1921 BrowserThread::PostTask( | 1921 BrowserThread::PostTask( |
1922 BrowserThread::IO, FROM_HERE, | 1922 BrowserThread::IO, FROM_HERE, |
1923 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread, | 1923 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread, |
1924 base::Unretained(prerender_tracker()), host->GetID(), false)); | 1924 base::Unretained(prerender_tracker()), host->GetID(), false)); |
1925 } | 1925 } |
1926 | 1926 |
1927 } // namespace prerender | 1927 } // namespace prerender |
OLD | NEW |