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_io_context.h" | 5 #include "chrome/browser/search/instant_io_context.h" |
6 | 6 |
7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
8 #include "content/public/browser/resource_context.h" | 8 #include "content/public/browser/resource_context.h" |
9 #include "content/public/browser/resource_request_info.h" | 9 #include "content/public/browser/resource_request_info.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 InstantIOContext::~InstantIOContext() { | 45 InstantIOContext::~InstantIOContext() { |
46 } | 46 } |
47 | 47 |
48 // static | 48 // static |
49 void InstantIOContext::SetUserDataOnIO( | 49 void InstantIOContext::SetUserDataOnIO( |
50 content::ResourceContext* resource_context, | 50 content::ResourceContext* resource_context, |
51 scoped_refptr<InstantIOContext> instant_io_context) { | 51 scoped_refptr<InstantIOContext> instant_io_context) { |
52 resource_context->SetUserData( | 52 resource_context->SetUserData( |
53 InstantIOContext::kInstantIOContextKeyName, | 53 InstantIOContext::kInstantIOContextKeyName, |
54 new base::UserDataAdapter<InstantIOContext>(instant_io_context)); | 54 new base::UserDataAdapter<InstantIOContext>(instant_io_context.get())); |
55 } | 55 } |
56 | 56 |
57 // static | 57 // static |
58 void InstantIOContext::AddInstantProcessOnIO( | 58 void InstantIOContext::AddInstantProcessOnIO( |
59 scoped_refptr<InstantIOContext> instant_io_context, | 59 scoped_refptr<InstantIOContext> instant_io_context, |
60 int process_id) { | 60 int process_id) { |
61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
62 instant_io_context->process_ids_.insert(process_id); | 62 instant_io_context->process_ids_.insert(process_id); |
63 } | 63 } |
64 | 64 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 InstantMostVisitedItem item; | 130 InstantMostVisitedItem item; |
131 if (most_visited_item_cache_.GetItemWithRestrictedID(most_visited_item_id, | 131 if (most_visited_item_cache_.GetItemWithRestrictedID(most_visited_item_id, |
132 &item)) { | 132 &item)) { |
133 *url = item.url; | 133 *url = item.url; |
134 return true; | 134 return true; |
135 } | 135 } |
136 | 136 |
137 *url = GURL(); | 137 *url = GURL(); |
138 return false; | 138 return false; |
139 } | 139 } |
OLD | NEW |