Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/instant_service.h" | 5 #include "chrome/browser/search/instant_service.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "chrome/browser/history/history_notifications.h" | 8 #include "chrome/browser/history/history_notifications.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/instant_io_context.h" | 10 #include "chrome/browser/search/instant_io_context.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 restricted_id, | 92 restricted_id, |
| 93 &url)) { | 93 &url)) { |
| 94 return url.spec(); | 94 return url.spec(); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 return path; | 97 return path; |
| 98 } | 98 } |
| 99 | 99 |
| 100 // static | 100 // static |
| 101 bool InstantService::IsInstantPath(const GURL& url) { | 101 bool InstantService::IsInstantPath(const GURL& url) { |
| 102 // Strip leading slash. | 102 return true; |
| 103 std::string path = url.path().substr(1); | |
| 104 | |
| 105 // Check that path is of Most Visited item ID form. | |
| 106 InstantRestrictedID dummy = 0; | |
| 107 return base::StringToInt(path, &dummy); | |
| 108 } | 103 } |
|
sreeram
2013/06/04 22:01:56
Why not just delete this method entirely?
pedro (no code reviews)
2013/06/07 23:34:21
Done.
| |
| 109 | 104 |
| 110 void InstantService::AddInstantProcess(int process_id) { | 105 void InstantService::AddInstantProcess(int process_id) { |
| 111 process_ids_.insert(process_id); | 106 process_ids_.insert(process_id); |
| 112 | 107 |
| 113 if (instant_io_context_) { | 108 if (instant_io_context_) { |
| 114 BrowserThread::PostTask( | 109 BrowserThread::PostTask( |
| 115 BrowserThread::IO, FROM_HERE, | 110 BrowserThread::IO, FROM_HERE, |
| 116 base::Bind(&InstantIOContext::AddInstantProcessOnIO, | 111 base::Bind(&InstantIOContext::AddInstantProcessOnIO, |
| 117 instant_io_context_, process_id)); | 112 instant_io_context_, process_id)); |
| 118 } | 113 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 BrowserThread::IO, FROM_HERE, | 171 BrowserThread::IO, FROM_HERE, |
| 177 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO, | 172 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO, |
| 178 instant_io_context_, process_id)); | 173 instant_io_context_, process_id)); |
| 179 } | 174 } |
| 180 break; | 175 break; |
| 181 } | 176 } |
| 182 default: | 177 default: |
| 183 NOTREACHED() << "Unexpected notification type in InstantService."; | 178 NOTREACHED() << "Unexpected notification type in InstantService."; |
| 184 } | 179 } |
| 185 } | 180 } |
| OLD | NEW |