| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 { | 88 { |
| 89 ASSERT(resource == m_resource); | 89 ASSERT(resource == m_resource); |
| 90 | 90 |
| 91 // If we got a status code indicating an invalid response, then lets | 91 // If we got a status code indicating an invalid response, then lets |
| 92 // ignore the data and not try to decode the error page as an icon. | 92 // ignore the data and not try to decode the error page as an icon. |
| 93 RefPtr<ResourceBuffer> data = resource->resourceBuffer(); | 93 RefPtr<ResourceBuffer> data = resource->resourceBuffer(); |
| 94 int status = resource->response().httpStatusCode(); | 94 int status = resource->response().httpStatusCode(); |
| 95 if (status && (status < 200 || status > 299)) | 95 if (status && (status < 200 || status > 299)) |
| 96 data = 0; | 96 data = 0; |
| 97 | 97 |
| 98 LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to da
tabase", resource->url().string().ascii().data()); | 98 LOG_INFO(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s
to database", resource->url().string().ascii().data()); |
| 99 m_frame->loader()->icon()->commitToDatabase(resource->url()); | 99 m_frame->loader()->icon()->commitToDatabase(resource->url()); |
| 100 // Setting the icon data only after committing to the database ensures that
the data is | 100 // Setting the icon data only after committing to the database ensures that
the data is |
| 101 // kept in memory (so it does not have to be read from the database asynchro
nously), since | 101 // kept in memory (so it does not have to be read from the database asynchro
nously), since |
| 102 // there is a page URL referencing it. | 102 // there is a page URL referencing it. |
| 103 iconDatabase().setIconDataForIconURL(data ? data->sharedBuffer() : 0, resour
ce->url().string()); | 103 iconDatabase().setIconDataForIconURL(data ? data->sharedBuffer() : 0, resour
ce->url().string()); |
| 104 m_frame->loader()->client()->dispatchDidReceiveIcon(); | 104 m_frame->loader()->client()->dispatchDidReceiveIcon(); |
| 105 stopLoading(); | 105 stopLoading(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } | 108 } |
| OLD | NEW |